<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<c:if test="${user.userId!='0'}">
	<table>
	     <tr ><td>Hello <c:out value="${user.customer.firstName}" /></td></tr>
	     <tr ><td><a href="<c:url value="/logout"/>">logout</a></td></tr >
	     <tr ><td><a href="<c:url value="/customer"/>">edit profile</a></td></tr >
	     <tr ><td><a href="<c:url value="/order/cart"/>">cart</a></td></tr >
	     <tr ><td><a href="<c:url value="/order"/>">orders</a></td></tr >
	</table>
</c:if>

<c:if test="${loginError}">
	<p>login failed!</p>
</c:if>
<c:if test="${user.userId=='0'}">
	<form action="<c:url value="/login"/>" method="post">
	<table>
	     <tr ><td>username:</td><td><input type="login" size="15" name="login" ></td></tr>
	     <tr><td>password:</td><td><input type="password" size="15" name="password"></td></tr>
	     <tr ><td></td><td><input type="submit" value="Submit"></td></tr>
	     <tr ><td><a href="<c:url value="/user/userForm"/>">register</a></td></tr>
	     <tr ><td><a href="<c:url value="/order/cart"/>">cart</a></td></tr >
	</table>
	</form>
</c:if>